package es.udc.emarketapp.emarket.model.purchase.purchaseFacade.actions;

import java.sql.Connection;

import es.udc.emarketapp.emarket.model.purchase.dao.SQLPurchaseDAO;
import es.udc.emarketapp.emarket.model.purchase.dao.SQLPurchaseDAOFactory;
import es.udc.emarketapp.emarket.model.purchase.vo.PurchaseVO;
import es.udc.fbellas.j2ee.util.exceptions.InstanceNotFoundException;
import es.udc.fbellas.j2ee.util.exceptions.InternalErrorException;
import es.udc.fbellas.j2ee.util.sql.TransactionalPlainAction;


public class ModifyPurchaseAction implements TransactionalPlainAction {

    private PurchaseVO purchaseVO;
    
    public ModifyPurchaseAction(PurchaseVO purchaseVO) {
        this.purchaseVO = purchaseVO;
    }
    
    public Object execute(Connection connection) 
        throws InternalErrorException, InstanceNotFoundException {        

        SQLPurchaseDAO purchaseDAO = SQLPurchaseDAOFactory.getDAO();

        purchaseDAO.update(connection, purchaseVO);  
        
        return null;

    }


}

